#include <svr_skeleton.h>

extern char *SERVER_NAME;

int tpsvrinit(int argc,	char *argv[])
{/*{{{*/
    char location[LONG_FILE_NM_SIZE];
    int res;

    ossl_init();

    sprintf(location, "%s/log", getenv("LOG"));
    res=init_errlog(SERVER_NAME, location);
    if(res)
    {
        userlog("%s: Server(%s) init log fail\n",
               __func__, SERVER_NAME);
        return(-1);
    }

    if(tpopen() == -1)
    {
        userlog("%s: Server(%s) tpopen fail:%s\n",
               __func__, SERVER_NAME, tpstrerror(tperrno));
        return(-1);
    }

    userlog("Server(%s): boot succeed\n", SERVER_NAME);
    return(0);
}/*}}}*/

void tpsvrdone(void)
{/*{{{*/
    if(tpclose() == -1)
    {
        userlog("%s: Server(%s): tpclose fail:%s\n",
                __func__, SERVER_NAME, tpstrerror(tperrno));
    }
    userlog("Server(%s): shutdown succeed\n", SERVER_NAME);
}/*}}}*/
